﻿using System;

namespace TheHeGeo.Util.Validate
{
    public class ObjValidateDoubleGreater:ObjValidateInt32
    {
        public double Delta { get; set; }
        public bool CanEquals { get; set; }
        public ObjValidateDoubleGreater(string errStr,double delta, bool canEquals) : base(errStr)
        {
            Delta = delta;
            CanEquals = canEquals;
        }

        public override bool IsValidate(object value)
        {
            return base.IsValidate(value)&&(CanEquals?Delta>=Convert.ToDouble(value):Delta>Convert.ToDouble(value));
        }
    }
}